package downloadpdfCleaner;

public enum FILETYPE {

	MOBI("mobi"), EPUB("mobi"), M4A("m4a"), CBR("cbr"), JPG("jpg"), TXT("txt"), PDF("pdf"), ZIP("zip"), RAR("rar"), MP3(
			"mp3"), PPT("ppt"), PPTX("pptx"), AAC("aac"), AVI("avi"), MP4("mp4"), M4U("m4u"), WMV("wmv"), XLS("xls"), XLSX(
			"xlsx"), DOC("doc"), DOCX("docx"), NULL("null");

	String ext;

	FILETYPE(String ext) {
		this.ext = ext;
	}

	String getExt() {
		return this.ext;
	}

	boolean equal(String ext) {
		if (this.ext.equalsIgnoreCase(ext))
			return true;
		else
			return false;
	}

	public static FILETYPE getFileType(String ext) {

		FILETYPE filetype = NULL;

		for (FILETYPE each : FILETYPE.values()) {
			if (each.ext.equalsIgnoreCase(ext)) {
				filetype = each;
				break;
			}
		}
		return filetype;
	}
}
